﻿<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:espace="espace:StringHelper">
	<xsl:output method="text" />
	<xsl:template match="/">using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Linq;
using NHibernate.Criterion;
using <xsl:value-of select="Schema/@EntityNameSpace" />;
using <xsl:value-of select="Schema/@ContractsNameSpace" />;
using <xsl:value-of select="Schema/@BusinessNameSpace" />;

namespace <xsl:value-of select="Schema/@NameSpace" />
{
	public class <xsl:value-of select="Schema/@TableName" />Service
	{

		public <xsl:value-of select="Schema/@TableName" />Service()
		{
		
		}

		public object Save(<xsl:value-of select="Schema/@TableName" /> entity)
		{

			<xsl:value-of select="Schema/@TableName" />Biz biz = new <xsl:value-of select="Schema/@TableName" />Biz();
			return biz.Save(entity);
				
		}
		
		public void Update(<xsl:value-of select="Schema/@TableName" /> entity)
		{
			<xsl:value-of select="Schema/@TableName" />Biz biz = new <xsl:value-of select="Schema/@TableName" />Biz();
			biz.Update(entity);
			
		}
		
		public void Delete(<xsl:value-of select="Schema/@TableName" /> entity)
		{
			<xsl:value-of select="Schema/@TableName" />Biz biz = new <xsl:value-of select="Schema/@TableName" />Biz();
			
			biz.Delete(entity);
		}
		
		public <xsl:value-of select="Schema/@TableName" /> Get(object id)
		{
			<xsl:value-of select="Schema/@TableName" />Biz biz = new <xsl:value-of select="Schema/@TableName" />Biz();
			return biz.Get(id);

			
		}
		
		public IList&lt;<xsl:value-of select="Schema/@TableName" />&gt; LoadAll()
		{
			<xsl:value-of select="Schema/@TableName" />Biz biz = new <xsl:value-of select="Schema/@TableName" />Biz();
			return biz.LoadAll();
			
			
		}

	}

}
	</xsl:template>
</xsl:stylesheet>